package com.web.dgfight.client;

public class TimerEvents {
	
	public TimerEvents() {
		
	if (AQ.attackQueue.peek() == null ) {
		  DGFightWeb.lblAttackScore.setText("0");		    		  		    		  
	  } 		    	  
	  else {
		  final Integer currentAttack = AQ.attackQueue.poll();
		  DGFightWeb.currentHealth = DGFightWeb.currentHealth - currentAttack;
		  DGFightWeb.lblHealthScore.setText(Integer.toString(DGFightWeb.currentHealth));
		  DGFightWeb.lblAttackScore.setText(currentAttack.toString());
	  
	  final Integer[] attackQueueArray = AQ.attackQueue.toArray(new Integer[0]);
	  for (int i = 0; i < AQ.attackQueue.size(); i++){
		  DGFightWeb.attackListGrid.setText(i, 0, attackQueueArray[i].toString());
	  }
	  }
	  for (int i = AQ.attackQueue.size(); i < 5; i++){
		  DGFightWeb.attackListGrid.setText(i, 0, " ");
	  }

}
}